﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Enterprise.Migrations
{
    public partial class addEditIndex : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateIndex(
                name: "INDEX_HIS_ORDERS",
                table: "HIS_ORDERS",
                columns: new[] { "PATIENT_ID", "VISIT_ID", "ORDER_NO", "ORDER_SUB_NO" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "INDEX_HIS_OPERATION",
                table: "HIS_OPERATION",
                columns: new[] { "PATIENT_ID", "VISIT_ID", "OPERATION_ID" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "INDEX_HIS_LAB_TEST",
                table: "HIS_LAB_TEST",
                columns: new[] { "PATIENT_ID", "VISIT_ID", "LAB_TEST_NO" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "INDEX_LAB_RESULT",
                table: "HIS_LAB_RESULT",
                columns: new[] { "LAB_TEST_NO", "ITEM_NO" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "INDEX_HIS_EXAM_REPORT",
                table: "HIS_EXAM_REPORT",
                columns: new[] { "EXAM_NO", "REPORT_NO" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "INDEX_HIS_EXAM",
                table: "HIS_EXAM",
                columns: new[] { "PATIENT_ID", "VISIT_ID", "EXAM_NO" },
                unique: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "INDEX_HIS_ORDERS",
                table: "HIS_ORDERS");

            migrationBuilder.DropIndex(
                name: "INDEX_HIS_OPERATION",
                table: "HIS_OPERATION");

            migrationBuilder.DropIndex(
                name: "INDEX_HIS_LAB_TEST",
                table: "HIS_LAB_TEST");

            migrationBuilder.DropIndex(
                name: "INDEX_LAB_RESULT",
                table: "HIS_LAB_RESULT");

            migrationBuilder.DropIndex(
                name: "INDEX_HIS_EXAM_REPORT",
                table: "HIS_EXAM_REPORT");

            migrationBuilder.DropIndex(
                name: "INDEX_HIS_EXAM",
                table: "HIS_EXAM");
        }
    }
}
